package com.ruifu.common.feign.factory;

import com.ruifu.common.feign.RemoteWorkSheetService;
import com.ruifu.common.feign.fallback.RemoteWsServiceFallbackImpl;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author yuanyundi
 * @create 2020/05/15
 */
@Component
public class RemoteWsServiceFallbackFactory implements FallbackFactory<RemoteWorkSheetService> {
    @Override
    public RemoteWorkSheetService create(Throwable throwable) {
        RemoteWsServiceFallbackImpl remoteWsServiceFallbackImpl = new RemoteWsServiceFallbackImpl();
        remoteWsServiceFallbackImpl.setCause(throwable);
        return remoteWsServiceFallbackImpl;
    }
}
